bloc

@JvmName(name = "bloc")
fun <State : Any, Action : Any, SideEffect : Any, Proposal : Any> bloc(context: BlocContext, blocState: BlocState<State, Proposal>, block: BlocBuilder<State, Action, SideEffect, Proposal>.() -> Unit = {}): Bloc<State, Action, SideEffect>

Creates a Bloc instance using a BlocBuilder.

bloc<State, Action, SideEffect, Proposal>(context, blocState) {
thunk { getState, action, dispatch ->
...
}
sideEffect { state, action ->
...
}
reduce { state, action ->
...
}
}

@JvmName(name = "blocProposalEqualsState")
fun <State : Any, Action : Any, SideEffect : Any> bloc(context: BlocContext, blocState: BlocState<State, State>, block: BlocBuilder<State, Action, SideEffect, State>.() -> Unit = {}): Bloc<State, Action, SideEffect>

Creates a Bloc instance using a BlocBuilder.

  • Proposal == State

bloc<State, Action, SideEffect>(context, blocState) {
...
}